package org.grapes.wine.api.client.exception;

import org.apache.log4j.Logger;

public class WineException extends Exception {

	static Logger logger = Logger.getLogger(WineException.class);
	private static final long serialVersionUID = -1170936813153338795L;

	private int errCode;

	public WineException() {
	}

	public WineException(String ex) {
		super(ex);
	}

	public WineException(int errCode, String message) {
		super(message);
		this.errCode = errCode;
		logger.debug("error code: " + errCode);
		logger.debug("message: " + message);		
	}

	public int getErrCode() {
		return errCode;
	}

	@Override
	public String toString() {
		return super.toString() + getMessage() + " " + errCode;
	}
}
